﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Perseus.WCF.REST.Contract.Data;
using Perseus.WCF.DAL;

namespace Perseus.WCF.Sequence
{
    public class UpdateEmpFlow : IBoolFlow
    {
        public string EmpId { get; set; }
        public Employee Employee { get; set; }

        public bool Go()
        {
            SqlDbUtil db = new SqlDbUtil();
            string sql = "update Employees set FirstName='" + Employee.FirstName + "', LastName='"
                       + Employee.LastName + "', BirthDate='" + Employee.BirthDate + "' "
                       + "where EmployeeID=" + EmpId;
            if (db.ExecuteSQL(sql) > 0)
                return true;

            return false;
        }
    }
}
